package TwoDay;

import java.util.Scanner;

public class noon3 {
    public static void main(String[] args) {
        int nowy,nowm,nowd,birthy,birthm,birthd;
        Scanner scanner = new Scanner(System.in);
        System.out.printf("请输入你的生日");
        System.out.printf("请输入你的年份");
        birthy = scanner.nextInt();
        System.out.printf("请输入你的月份");
        birthm = scanner.nextInt();
        System.out.printf("请输入你的日期");
        birthd = scanner.nextInt();
        System.out.printf("请输入现在的日期");
        nowy = scanner.nextInt();
        System.out.printf("请输入现在的月份");
        nowm = scanner.nextInt();
        System.out.printf("请输入现在的日期");
        nowd = scanner.nextInt();
        int age = nowy-birthy;
        if (birthm<nowm){
            age=age-1;
        }if (birthm==nowm&&nowd>birthd){
            age=age-1;
        }
        System.out.printf("你的年龄是：");
        System.out.println("age = " + age);

    }
}
